package idl

type Submission struct {
	Sid int64 `json:"sid" mapstructure:"sid,omitempty"`
	Cid int64 `json:"cid" mapstructure:"cid,omitempty"` //
	Pid int64 `json:"pid" mapstructure:"pid,omitempty"` //
	Uid int64 `json:"uid" mapstructure:"uid,omitempty"` //index
	//UserName string `json:"user_name,omitempty"` //nickname
	//Code   string `json:"code,omitempty"`   //input body
	Result int `json:"result" mapstructure:"result,omitempty"` //AK,AC,Fail
	//result from judgeServer
	ResInfo  string `json:"res_info" mapstructure:"res_info,omitempty"` //json
	Language string `json:"language"  mapstructure:"language,omitempty"`
	//Shared        bool           `json:"shared" gorm:"default:false,omitempty"` //default=false
	ErrCode    string `json:"err_code" mapstructure:"err_code,omitempty"` //json:dict
	CommitTime int64  `json:"commit_time" xorm:"created" mapstructure:"commit_time,omitempty"`
	ExpireTime int64  `json:"expire_time" mapstructure:"expire_time,omitempty"` //
}

type RunResult struct {
	CpuTime    int    `json:"cpu_time"`
	RealTime   int    `json:"real_time"`
	Memory     int    `json:"memory"`
	Signal     int    `json:"signal"`
	ExitCode   int    `json:"exit_code"`
	ErrorCode  int    `json:"error_code"`
	Output     string `json:"output"`
	ResultCode int    `json:"result_code"`
}

type JResult struct {
	Sid      string
	Passed   []RunResult
	UnPassed []RunResult
}
